#ifndef __AIDIKEENCODER_H
#define __AIDIKEENCODER_H

#include "rclcpp/rclcpp.hpp"
#include <string>
#include <encoder/encoder.h>
#include <std_msgs/msg/u_int32.hpp>
#include <std_msgs/msg/float64.hpp>

namespace encoder {

class AidikeEncoder : public Encoder
{
public:
    AidikeEncoder(std::shared_ptr<rclcpp::Node> node, const std::string joint_name);
    ~AidikeEncoder();

    void        init();
    uint64_t    getValue();
    int64_t     getTurns();
    double      getRadValue();
    void        enc_sub_callback(const std_msgs::msg::UInt32::ConstSharedPtr& msg);
    void        timestamp_sub_callback(const std_msgs::msg::Float64::ConstSharedPtr& msg);


private:
    std::shared_ptr<rclcpp::Node>  node_;
    uint32_t                raw_value_;
    rclcpp::Subscription<std_msgs::msg::UInt32>::SharedPtr   enc_sub_;
    rclcpp::Subscription<std_msgs::msg::Float64>::SharedPtr  timestamp_sub_;
    int                     encoder_resolution_;
    double                  reduction_ratio_;
};



}



#endif